package com.loan.common.core.page;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * 分页工具类
 *
 * @param <T>
 * @author shiguang
 */
@Data
@ApiModel(description = "PageData")
public class PageData<T> implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "记录总数")
    private int total;

    @ApiModelProperty(value = "列表数据")
    private List<T> list;

    public PageData() {

    }

    public PageData(List<T> list, long total) {
        this.list = list;
        this.total = (int) total;
    }
}
